﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using NHibernate.Mapping.Attributes;

namespace VemTransporte.Models.Basica
{
    [Class(Table="VeiculoParada")]
    public class VeiculoParada
    {
        #region Atributos
        private long id;
        private DateTime dataHora;
        private Veiculo _Veiculo;
        private Parada _Parada;
        #endregion

        #region Propriedades
        [Id(Name = "Id", Column = "PK_IdVeiculoParada")]
        [Generator(1, Class = "native")]
        public virtual long Id
        {
            get { return id; }
            set { id = value; }
        }

        [Column(Name="VPA_DataHora")]
        public virtual DateTime DataHora
        {
            get { return dataHora; }
            set { dataHora = value; }
        }

        [ManyToOne(Name = "Veiculo", Column = "FK_IdVeiculo", ClassType = typeof(Veiculo), Fetch = FetchMode.Join)]
        public virtual Veiculo Veiculo
        {
            get { return _Veiculo; }
            set { _Veiculo = value; }
        }

        [ManyToOne(Name = "Parada", Column = "FK_IdParada", ClassType = typeof(Parada), Fetch = FetchMode.Join)]        
        public virtual Parada Parada
        {
            get { return _Parada; }
            set { _Parada = value; }
        }
        #endregion

        #region Construtores
        public VeiculoParada() { }
        #endregion

    }
}